package com.aceitunaproject.server.message.processor;

import com.aceitunaproject.server.player.Player;
import com.aceitunaproject.shared.message.concrete.ActionListRequest;
import com.aceitunaproject.shared.message.concrete.ActionRequest;

/**
 * Handles Action Request Messages, iterating through each ActionRequest on the list and calling it's perform method  
 * 
 * @author Federico Bergstein
 *
 */
public class ActionListRequestProcessor implements MessageProcessor<ActionListRequest> {

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void processMessage(Player player, ActionListRequest message) {
		for(ActionRequest actionRequest : message.getActions()) {
			player.getMessageHandler().handleObjectMessage(player, actionRequest);
		}
	}

}
